#include <iostream>
using namespace std;
#include <vector>
int main(){
    int n, max = -10000;
    cin >> n;
    vector<vector<int>> arr(n+1, vector<int>(n+1));
    for (int i = 1; i <= n;i++){
        for (int j = 1; j <= n;j++){
            scanf("%d", &arr[i][j]);
        }
    }
    // 2.每个端点到第一个点的和
    vector<vector<int>> s(n+1, vector<int>(n+1));
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            s[i][j] = s[i - 1][j] + s[i][j - 1] + arr[i][j] - s[i - 1][j - 1];
        }
    }
    // 3.遍历求最大值
    int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
    //求不出来，每个矩阵的子矩阵和

    cout << max;
    return 0;
}